package com.zwz.control;

import com.zwz.control.util.R;
import com.zwz.service.ContentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/assess")
public class AssessControl {

    @Autowired
    private ContentsService contentsService;

    /**
     * 开始测评请求
     * @param tid 问卷的id，根据问卷id在数据库中查询该问卷的数据
     * @return
     */
    @GetMapping("/start/{tid}")
    public R startAssess(@PathVariable Integer tid){
        return new R(true,contentsService.startList(tid));

    }
}
